import request from '@/config/axios'

export function getAllProductGroupApi() {
	return request.get<ProductGroupVo[]>({
		url: '/game/g-product/readOnly/getAllProductGroup'
	})
}

export function getAllItemApi() {
	return request.get<GItem[]>({
		url: '/game/g-product/readOnly/getAllItem'
	})
}

export function getAllBuildingApi() {
	return request.get<GBuilding[]>({
		url: '/game/g-product/readOnly/getAllBuilding'
	})
}

export function getAllRecipeApi() {
	return request.get<GRecipe[]>({
		url: '/game/g-product/readOnly/getAllRecipe'
	})
}

export function getRecipeDetailByIdApi(recipeId: number) {
	return request.get<SearchRecipeVo>({
		url: '/game/g-product/readOnly/getRecipeDetailById/' + recipeId
	})
}

export function saveProductApi(data: SaveProductRequest) {
	return request.post({
		url: '/game/g-product/saveProduct',
		data
	})
}

export function getAllProductRequirementByProductIdApi(productId: number) {
	return request.get<GProductRequirement[]>({
		url: '/game/g-product/readOnly/getAllProductRequirementByProductId/' + productId
	})
}

export function getAllProductUnlockByProductIdApi(productId: number) {
	return request.get<GProductUnlock[]>({
		url: '/game/g-product/readOnly/getAllProductUnlockByProductId/' + productId
	})
}

export function deleteProductApi(id: number) {
	return request.delete({
		url: '/game/g-product/deleteProduct/' + id
	})
}

export function getAllProductRequirementVoByProductIdApi(productId: number) {
	return request.get<ProductRequirementVo[]>({
		url: '/game/g-product/readOnly/getAllProductRequirementVoByProductId/' + productId
	})
}

export function getAllProductUnlockVoByProductIdApi(productId: number) {
	return request.get<ProductUnlockVo[]>({
		url: '/game/g-product/readOnly/getAllProductUnlockVoByProductId/' + productId
	})
}

export function getProductCascadeClassificationApi() {
	return request.post<CascadeClassificationVo[]>({
		url: '/game/g-product/readOnly/getProductCascadeClassification'
	})
}
